package sz.com.postoffice.jxyzwgcase.utils;

import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;

/**
 * @ClassName ValidatorConfiguration
 * @Deacription TODO
 * @Author 王盟
 * @Date 2020/9/30 9:54
 * @Version 1.0
 **/

public class HibernateValidators {

    public static Validator validator(){
        ValidatorFactory validatorFactory = Validation.byProvider( org.hibernate.validator.HibernateValidator.class )
                .configure()
                .addProperty( "hibernate.validator.normal", "true" )
                .buildValidatorFactory();
        Validator validator = validatorFactory.getValidator();

        return validator;
    }
}